package interfaceandabstract.exercise;

public class Cat extends Animal implements CatchMouse {

    public Cat() {
    }

    public Cat(String gender, String alias, int age, int speed) {
        super(gender, alias, age, speed);
    }

    @Override
    public boolean catchMouse(Mouse m) {
        if(this.speed>m.speed){  //能否捉到老鼠取决于速度
            return  true;
        }
        return false;
    }

    @Override
    public void bark() {
        System.out.println("喵喵...");
    }
}
